<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
name('指定方法名'); “控制器/方法”

*/

Route::get('/', "StaticPage@home")->name('home');//主页路由
Route::get('/about', "StaticPage@about")->name('about');//关于路由
Route::get('/fq', "StaticPage@help")->name('help');//帮助路由
Route::get('signup',"UsersController@create")->name('signup');//注册路由
Route::resource('users',"UsersController");//用户相关的资源操作
//登陆相关的操作
Route::get('login', 'SessionsController@create')->name('login'); //get操作
Route::post('login', 'SessionsController@store')->name('login'); //post操作
Route::delete('logout', 'SessionsController@destroy')->name('logout');//退出登陆
//邮件操作
Route::get('signup/confirm/{token}','UsersController@confirmEmail')->name('confirm_email');//模拟发送邮件
//忘记密码操作发邮箱
Route::get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request');
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset');
Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('password.update');
//微博操作
Route::resource('statuses', 'StatusesController', ['only' => ['store', 'destroy']]);
//用户粉丝view
Route::get('/users/{user}/followings', 'UsersController@followings')->name('users.followings');
Route::get('/users/{user}/followers', 'UsersController@followers')->name('users.followers');
//关注、取消关注
Route::post('/users/followers/{user}', 'FollowersController@store')->name('followers.store');
Route::delete('/users/followers/{user}', 'FollowersController@destroy')->name('followers.destroy');
